<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>汇智人力资源管理系统</title>
  <style>



      .login-box{
          padding: 40px;
          margin-left: 400px;
          margin-top: 200px;
          opacity: .9;


      }

      .modal-footer{
          text-align: left !important;
      }

      .btn-login{
          width: 100%;
      }

     .login-bg{
         background-image: url('../img/bg1.jpg');
         background-repeat: no-repeat;
         background-size: cover;

     }

      .dark-mode {
          background-color: #454d55!important;
          color: #fff;
      }


     .modal-content{
       box-shadow: -8px 13px 10px 5px rgb(0 0 0 / 50%) !important;
     }

  </style>
  <link rel="stylesheet" href="../lib/bootstrap/css/bootstrap.css">

</head>
<body class="login-bg dark-mode">


 <div class="modal show login-box ">


     <div class="modal-dialog">

       <div class="modal-content dark-mode">

         <div class="modal-header">

          <h1>
            智慧人事-
            <small>
               系统登录
            </small>
          </h1>

         </div>


         <div class="modal-body " >

           <form class="form-horizontal">
             <div class="form-group">
               <label class="control-label col-md-4">用户名:</label>
               <div class="col-md-8">
                 <input type="text" class="form-control" id="username"/>
               </div>
             </div>
             <div class="form-group">
               <label class="control-label col-md-4">密码:</label>
               <div class="col-md-8">
                 <input type="password" class="form-control" id="password"/>
               </div>
             </div>
             <div class="form-group">
               <div class="col-md-offset-6">

               </div>

             </div>

           </form>
         </div>

         <div class="modal-footer">

             <div class=" col-md-offset-4">
               <button id="btnLogin" class="btn btn-success btn-login" type="button">
                 登陆
               </button>
             </div>

         </div>

       </div>


     </div>



   </div>






</body>
<script src="../lib/jquery.js"></script>
<script src="../lib/bootstrap/js/bootstrap.js"></script>
<script>

      $('#btnLogin').bind('click',btnLoginClick);


      function btnLoginClick() {


          $.ajax({
             url:'http://localhost:8088/user/login',
             method:'post',
             dataType:'json',
             data:{
               username:$('#username').val(),
               password:$('#password').val()
             },
            success:function (data) {
               if(data.flag){
                  window.location.href="index.html";
               }
            }
          })
      }

</script>

</html>
